#include "StdAfx.h"
#include <atlbase.h>
#include <atlcom.h>
#include <propkeydef.h>
#include <UIRibbonPropertyHelpers.h>
#include "RibbonCommandItem.h"

CRibbonCommandItem::CRibbonCommandItem(void)
{
}

CRibbonCommandItem::~CRibbonCommandItem(void)
{
}

STDMETHODIMP CRibbonCommandItem::GetValue(__in REFPROPERTYKEY key, __out PROPVARIANT *ppropvar)
{
	if (key == UI_PKEY_Label)
    {
        return UIInitPropertyFromString(UI_PKEY_Label, m_commandName.c_str(), ppropvar);
    }
	//else
    return S_FALSE;
}


STDMETHODIMP CRibbonCommandItem::Initialize(PCWSTR commandName, UINT32 nCmdID)
{
	m_commandName = commandName;
	m_nCmdID = nCmdID;
	return S_OK;
}

STDMETHODIMP CRibbonCommandItem::GetCommandId(UINT32 *commandId)
{
	*commandId = m_nCmdID;
	return S_OK;
}
